Skip to main content

Package manager benchmark

Comparing package manager (PM) to improve CI performances

Procedure

The following PM are considered:

Software used to test: hyperfine

hyperfine "bun install --backend=hardlink" "pnpm install --ignore-scripts" "yarn install --no-scripts" "npm install --force --no-scripts --ignore-scripts" --warmup=4 --prepare="rm -rf node_modules" --cleanup="rm -rf node_modules" --export-markdown="package-manager-benchmark.md"

Results

CommandMean [s]Min [s]Max [s]Relative
bun install --backend=hardlink1.014 ± 0.0660.9231.1311.00
pnpm install --ignore-scripts2.060 ± 0.0951.9552.2442.03 ± 0.16
yarn install --no-scripts7.883 ± 0.2347.5948.2997.77 ± 0.56
npm install --force --no-scripts --ignore-scripts10.155 ± 0.3249.71110.86010.01 ± 0.73

Date: 2024-01-23

Configuration

  • CPUs: 16
  • CPU Name: 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
  • Architecture: x86_64
  • Software: Ubuntu 22.04.3 LTS (Jammy)

Conclusion

The fastest tested package manager is bun but when using on the Windows platform, it lacks stability at the moment. Therefore, we can try pnpm.

To install:

# On MacOS and Linux
curl -fsSL https://get.pnpm.io/install.sh | sh -

# On Windows (using PowerShell)
iwr https://get.pnpm.io/install.ps1 -useb | iex